package com.llb666.e.shop.api.vo;


import com.llb666.e.shop.domain.entity.Items;
import com.llb666.e.shop.domain.entity.ItemsImg;
import com.llb666.e.shop.domain.entity.ItemsParam;
import com.llb666.e.shop.domain.entity.ItemsSpec;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.swing.*;
import java.util.List;

/**
 * 商品详情VO
 *
 * @author llb666
 */
@Data
public class ItemInfoVo {

    /**
     * 商品基础信息.
     */
    private Items item;

    /**
     * 商品图片信息.
     */
    private List<ItemsImg> itemImgList;

    /**
     * 商品规格信息.
     */
    private List<ItemsSpec> itemSpecList;

    /**
     * 商品参数信息.
     */
    private ItemsParam itemParams;


    public static ItemInfoVo convert(Items items, List<ItemsImg> itemsImgs,
                                     List<ItemsSpec> itemsSpecs, ItemsParam itemsParam) {
        ItemInfoVo itemInfoVo = new ItemInfoVo();
        itemInfoVo.item = items;
        itemInfoVo.itemImgList = itemsImgs;
        itemInfoVo.itemSpecList = itemsSpecs;
        itemInfoVo.itemParams = itemsParam;
        return itemInfoVo;
    }
}
